package com.shop.order.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.shop.order.mapper.ShopOrderMapper;
import com.shop.order.domain.ShopOrder;
import com.shop.order.service.IShopOrderService;

/**
 * 订单信息Service业务层处理
 *
 * @author wuhao
 * @date 2022-04-06
 */
@Service
public class ShopOrderServiceImpl implements IShopOrderService {
    @Autowired
    private ShopOrderMapper shopOrderMapper;

    /**
     * 查询订单信息
     *
     * @param id 订单信息主键
     * @return 订单信息
     */
    @Override
    public ShopOrder selectShopOrderById(String id) {
        return shopOrderMapper.selectShopOrderById(id);
    }

    /**
     * 查询订单信息列表
     *
     * @param shopOrder 订单信息
     * @return 订单信息
     */
    @Override
    public List<ShopOrder> selectShopOrderList(ShopOrder shopOrder) {
        return shopOrderMapper.selectShopOrderList(shopOrder);
    }

    /**
     * 新增订单信息
     *
     * @param shopOrder 订单信息
     * @return 结果
     */
    @Override
    public int insertShopOrder(ShopOrder shopOrder) {
        return shopOrderMapper.insertShopOrder(shopOrder);
    }

    /**
     * 修改订单信息
     *
     * @param shopOrder 订单信息
     * @return 结果
     */
    @Override
    public int updateShopOrder(ShopOrder shopOrder) {
        return shopOrderMapper.updateShopOrder(shopOrder);
    }

    /**
     * 批量删除订单信息
     *
     * @param ids 需要删除的订单信息主键
     * @return 结果
     */
    @Override
    public int deleteShopOrderByIds(String[] ids) {
        return shopOrderMapper.deleteShopOrderByIds(ids);
    }

    /**
     * 删除订单信息信息
     *
     * @param id 订单信息主键
     * @return 结果
     */
    @Override
    public int deleteShopOrderById(String id) {
        return shopOrderMapper.deleteShopOrderById(id);
    }

    /**
     * 查看我的订单
     *
     * @param userId 订单信息主键
     * @return 结果
     */
    @Override
    public List<ShopOrder> selectOrderByUserId(String userId) {
        return shopOrderMapper.selectOrderByUserId(userId);
    }

    /**
     * 通过订单状态查看订单信息
     *
     * @param shopOrder 订单信息主键
     * @return 结果
     */
    @Override
    public List<ShopOrder> selectOrderByStatus(ShopOrder shopOrder) {
        return shopOrderMapper.selectOrderByStatus(shopOrder);
    }
}
